-
Notifications
You must be signed in to change notification settings - Fork 109
Add hard coded patched for tests #942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add hard coded patched for tests #942
Conversation
…ote the 80s of each case to test values, following the suite of 70s be inheretived value. No particular reason for this other than to keep it away from interesting cases.
… how these patches are added. Will do that soon.
…reading up on patch types
… geometry. There is no way to handle that in the code currently, so I will be adding it in a future commit to resolve the final two examples
…, adn 15 in a future release
…erences to hard coded patches in the case documentaiton
PR Reviewer Guide 🔍(Review updated until commit 03622a1)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 03622a1
Previous suggestions✅ Suggestions up to commit 45d40e8
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #942 +/- ##
==========================================
+ Coverage 43.76% 44.07% +0.30%
==========================================
Files 68 68
Lines 18378 18227 -151
Branches 2292 2289 -3
==========================================
- Hits 8044 8033 -11
+ Misses 8945 8829 -116
+ Partials 1389 1365 -24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added several comments. also, some of these hardcoded examples are important. it would be useful to somehow check that you didn't break the case when you switched from analytical to hardcoded.
also probably won't merge this until analytical examples are added (but skipped in the test suite). Presumably, we only need a few of these.
…lchain to skip them so that they do not slow down the test suite.
Converted these iterators to integers.
@@ -74,11 +76,15 @@ contains | |||
elseif (patch_icpp(i)%geometry == 12) then | |||
call s_check_ellipsoid_patch_geometry(i) | |||
elseif (patch_icpp(i)%geometry == 13) then | |||
call s_check_3D_analytical_patch_geometry(i) | |||
call s_mpi_abort('geometry 13 (formerly "3D Hardcoded")'// & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have @:prohibit and prohibit_abort for this
call s_check_1d_analytical_patch_geometry(i) | ||
call s_mpi_abort('geometry 15 (formerly "1D Hardcoded")'// & | ||
'is no longer supported for patch '//trim(iStr)// & | ||
'. Exiting.') | ||
elseif (patch_icpp(i)%geometry == 16) then | ||
print *, '1d pressure sinusoid' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we can remove all of these elseifs that just print something. i added them years ago and i don't think they are helping anyone.
|
||
end subroutine s_circle | ||
|
||
! TODO :: Determine if we want analytical and hardcoded patches for the airfoil geometries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't, can remove this
This seems fine to me, pending removing some comments / extra junk. Also, if @wilfonba approves, since he uses a lot of these features and added some of them to the code to begin with. |
@@ -313,7 +314,7 @@ These parameters should be prepended with `patch_ib(j)%` where $j$ is the patch | |||
#### Parameter Descriptions | |||
|
|||
- `geometry` defines the type of geometry of a patch with an integer number. | |||
Definitions for currently implemented patch types are list in table [Immersed Boundary Patch Type](#immersed-boundary-patch-types) | |||
Definitions for currently implemented patch types are list in table [Patch Types](#patch-types). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be reverted unless I'm missing something. The "immersed boundary patch types" table appears to still exist.
q_prim_vf(E_idx)%sf(i, j, 0) = 1.0*(1.0 - (1.0/1.0)*(5.0/(2.0*3.141592653589793))*(5.0/(8.0*1.0*(1.4 + 1.0)*3.141592653589793))*exp(2.0*1.0*(1.0 - (x_cc(i) - patch_icpp(1)%x_centroid)**2.0 - (y_cc(j) - patch_icpp(1)%y_centroid)**2.0)))**(1.4 + 1.0) | ||
q_prim_vf(contxb + 0)%sf(i, j, 0) = 1.0*(1.0 - (1.0/1.0)*(5.0/(2.0*3.141592653589793))*(5.0/(8.0*1.0*(1.4 + 1.0)*3.141592653589793))*exp(2.0*1.0*(1.0 - (x_cc(i) - patch_icpp(1)%x_centroid)**2.0 - (y_cc(j) - patch_icpp(1)%y_centroid)**2.0)))**1.4 | ||
q_prim_vf(momxb + 0)%sf(i, j, 0) = 0.0 + (y_cc(j) - patch_icpp(1)%y_centroid)*(5.0/(2.0*3.141592653589793))*exp(1.0*(1.0 - (x_cc(i) - patch_icpp(1)%x_centroid)**2.0 - (y_cc(j) - patch_icpp(1)%y_centroid)**2.0)) | ||
q_prim_vf(momxb + 1)%sf(i, j, 0) = 0.0 - (x_cc(i) - patch_icpp(1)%x_centroid)*(5.0/(2.0*3.141592653589793))*exp(1.0*(1.0 - (x_cc(i) - patch_icpp(1)%x_centroid)**2.0 - (y_cc(j) - patch_icpp(1)%y_centroid)**2.0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a constant for pi
in m_constants
that will clean these lines up a lot
case (181) | ||
! This is patch is hard-coded for test suite optimization used in the | ||
! 1D_titarevtorro cases: "patch_icpp(2)%alpha_rho(1)": "1 + 0.1*sin(20*x*pi)" | ||
q_prim_vf(contxb + 0)%sf(i, 0, 0) = 1 + 0.1*sin(20*x_cc(i)*3.141592653589793) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a constant for 'pi' in 'm_constants' that will clean these lines up a lot
I added some minor comments. I don't see any other issues with these changes |
User description
Description
The primary intent of this PR is to remove hardcoded patches from the test suite, preventing the need to recompile them and saving time during testing. In doing so, I also refactored the geometries because we had no existing support for creating hard-coded patches on any geometries other than line segments, rectangles, and cuboids. Now we can generate hard-coded patches on almost any geometries except for the airfoil geometries (I left a TODO about this) and the model (STL) geometry (this will require it's own dedicated refactor). I also changed every test that used analytic patches to use new hard coded patches, added comments to some code in the toolchain, and updated the docs to note that the old analytic geometry patches are deprecated. I left a print statement warning that those geometries are deprecated, and we should delete them after some time. For now, I had then call subroutines that recreated their original functionality.
TODO :: After this PR, we should go back and add the analytic patches as examples that will be skipped so that they are present for external reference.Type of change
Please delete options that are not relevant.
Scope
If you cannot check the above box, please split your PR into multiple PRs that each have a common goal.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration
./mfc.sh test -j $(nproc)
)Test Configuration:
All of my testing was done locally on Ubuntu with the intel and non-intel compilers.
Checklist
docs/
)examples/
that demonstrate my new feature performing as expected.They run to completion and demonstrate "interesting physics"
./mfc.sh format
before committing my codeIf your code changes any code source files (anything in
src/simulation
)To make sure the code is performing as expected on GPU devices, I have:
nvtx
ranges so that they can be identified in profiles./mfc.sh run XXXX --gpu -t simulation --nsys
, and have attached the output file (.nsys-rep
) and plain text results to this PR./mfc.sh run XXXX --gpu -t simulation --rsys --hip-trace
, and have attached the output file and plain text results to this PR.PR Type
Enhancement, Tests
Description
Replace analytical patches with hardcoded patches for test optimization
Remove deprecated geometry types 7, 13, and 15
Add hardcoded patch support across all geometry types
Update test cases to use new hardcoded patch system
Changes diagram
Changes walkthrough 📝
5 files
Remove analytical patches and add hardcoded support
Add 2D hardcoded patch cases 280-282
Remove deprecated geometry type checks
Add 3D hardcoded patch case 380
Add 1D hardcoded patch cases 180-181
1 files
Add variable declaration for loop iterator
1 files
Add comments to analytical function generation
13 files
Create analytical version of zero circulation vortex
Create analytical version of isentropic vortex
Create analytical version of acoustic pulse
Create analytical version of Taylor-Green vortex
Create analytical version of Shu-Osher test
Create analytical version of Titarev-Torro test
Skip analytical test cases during testing
Update to use hardcoded patch HCID 282
Update to use hardcoded patch HCID 380
Update to use hardcoded patch HCID 281
Update to use hardcoded patch HCID 280
Update to use hardcoded patch HCID 180
Update to use hardcoded patch HCID 181
14 files